<template>
  <div class="transaction-password">
    <div class="page-title" style="cursor: pointer;" @click="handleGoBack">
      <i class="el-icon-arrow-left"></i> 交易密码
    </div>
    <el-form ref="formRef" :model="formData" :rules="rules" label-position="top">
      <el-form-item label="旧密码" prop="old">
        <el-input type="password" placeholder="请输入旧密码" show-password v-model="formData.old"/>
      </el-form-item>
      <el-form-item label="新密码" prop="new">
        <el-input type="password" placeholder="请输入新密码" show-password v-model="formData.new"/>
      </el-form-item>
      <el-form-item label="确认密码" prop="confirm">
        <el-input type="password" placeholder="请输入确认密码" show-password v-model="formData.confirm"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" size="large" class="sing-in-btn" @click="handleModify">确定</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script setup>
  import { ref, reactive } from 'vue'
  import router from '@/router'
  const formRef = ref()
  const formData = reactive({
    old: '',
    new: '',
    confirm: ''
  })
  const rules = {
    old: [{ required: true, message: '密码必填', trigger: 'blur' }],
    new: [{ required: true, message: '密码必填', trigger: 'blur' }],
    confirm: [{ required: true, message: '确认密码必填', trigger: 'blur' }]
  }
  const handleGoBack = () => {
    router.go(-1)
  }
</script>
<style scoped>
.transaction-password{
  width: 422px;
}
.page-title {
  font-weight: 700;
  font-size: 24px;
  color: #333;
}
:deep(.el-form ){
  margin-top: 50px;
}
:deep(.el-form-item) {
  margin-bottom: 22px;
}
.transaction-password .eye-icon{
  width: 30px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transaction-password .eye-icon > img{
  width: 14px;
  margin: 0px;
}
.el-form-item__content {
  line-height: 40px;
  position: relative;
  font-size: 14px;
}
.form .form-submit-btn {
  width: 100%;
  display: block;
  background-color: var(--color-main);
  color: rgb(255, 255, 255);
  height: 52px;
  margin-top: 50px;
}
</style>